package com.kla.power.util;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: Wuzh
 * @Description:
 * @Date Created in 23:39 2024-06-02
 * @return
 */
public class AlarmUtil {


    /**
     * map集合存警告键值
     * @param key 为bit位
     * @param value 为警告
     */
    private static Map<Integer, String> map = new HashMap<> ();

    //00100000000000100000000000000000
    //遍历从bit0开始判断有哪些异常
    static {
        map.put ( 0, "漏电流检测设备故障" );
        map.put ( 1, "输出电流传感器故障" );
        map.put ( 2, "2.5V故障" );
        map.put ( 3, "M-S的直流输入不同" );
        map.put ( 4, "M-S的接地I不同" );
        map.put ( 6, "高直流母线" );
        map.put ( 7, "设备故障" );
        map.put ( 9, "电网断开" );
        map.put ( 10, "对地漏电流过大" );
        map.put ( 11, "总线故障" );
        map.put ( 12, "过流" );
        map.put ( 13, "温度过高" );
        map.put ( 14, "自动测试" );
        map.put ( 15, "过压" );
        map.put ( 17, "电网电压超范围" );
        map.put ( 18, "对地绝缘故障" );
        map.put ( 19, "DC INJ高" );
        map.put ( 20, "M-S的Fac、Vac不同" );
        map.put ( 22, "M-S的Fac不同" );
        map.put ( 23, "M-S的Vac不同" );
        map.put ( 25, "继电器自检失败失败" );
        map.put ( 29, "Fac故障" );
        map.put ( 30, "存储芯片读写失败" );
        map.put ( 31, "SCI失败" );
    }

    public static String getAlarm (int key) {
        String value = map.get ( key );
        return value;
    }

}
